<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>短信验证</title>
	<script>
		
onload = function() {
	var oSend = document.getElementsByTagName('input')[1];
	setSend(oSend);
}

function setSend(obj) {
	var second = 10;

	obj.onclick = function() {
		if (this.timeId) {
			return true;
		}
		this.value = second + '秒后再次发送';
		var _this = this;
		this.timeId = setInterval(function(){

												second--;
												_this.value = second + '秒后再次发送';
												if (second == 0) {
													clearInterval(_this.timeId);
													this.timeId = null;
													second = 10;
													_this.value = '点击再次发送';

												}
										},1000);
	}
}


	</script>
</head>
<body>
	<input type="text">
	<input type="button" value="短信验证">
</body>
</html>